package lab02.test03;

public class Test03 {
    public static void main(String[] args) {
        Student sc=new Student(60,60,60);
        sc.print();

    }
}

class Student {

    float computers;
    float math;
    float english;

    public Student(){}

    public Student (float computers,float math,float english){
        this.computers=computers;
        this.english=english;
        this.math=math;
    }

    public void setComputer(float computer) {
        this.computers = computer;
    }

    public float getComputer() {
        return computers;
    }

    public void setEnglish(float english) {
        english = english;
    }

    public float getEnglish() {
        return english;
    }

    public void setMath(float math) {
        this.math = math;
    }

    public float getMath() {
        return math;
    }


    public float totalScore(){

        return computers+math+english;
    }

    public float averageScore(){
        return (computers+math+english)/3;
    }

    public float maxScore(){
        float max=0;
        max=(computers>math?computers:math);
        max=(english>max? english:max);
        return max;
    }

    public float minScore(){
        float min=0;
        min=(computers<math?computers:math);
        min=(english<min? english:min);
        return min;
    }

    public void print(){

        System.out.println("计算机成绩：" + computers);
        System.out.println("数学成绩：" + math);
        System.out.println("英语成绩：" + english);

        System.out.println("总分："+totalScore());
        System.out.println("平均分："+averageScore());
        System.out.println("最低分："+minScore());
        System.out.println("最高分："+maxScore());

    }


}

